import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/fenlei',  // 重定向:重新指向其它path,会改变网址
  },
  {
    path: '/about',
    name: 'About',
    // 路由懒加载
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/bag',
    // 路由懒加载
    component: () => import(/* webpackChunkName: "about" */ '../views/bag.vue')
  },
  {
    path: '/fenlei',
    // 路由懒加载
    component: () => import(/* webpackChunkName: "about" */ '../views/classify.vue')
  },
  {
    path: '/paihang',
    // 路由懒加载
    component: () => import(/* webpackChunkName: "about" */ '../views/sort.vue')
  },
  {
    path: '/jingxuan',
    // 路由懒加载
    component: () => import(/* webpackChunkName: "about" */ '../views/select.vue')
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
